<template>
<div class="return-address views-container">
    <div class="wlm-table" style="padding-bottom:40px;">
        <div class="wlm-table-hearder-btn">
            <router-link tag="span" to="/setting/returnAddressAdd">
                <el-button size="small" type="primary">新增退货地址</el-button>
            </router-link>
        </div>
        <div class="wlm-table-content">
            <el-table :ref="tableFormatData.platformPack.key" :data="tableFormatData.platformPack.tableData" @selection-change="handleSelectionChange" style="width: 100%">
                <el-table-column prop="date" label="地址ID" >
                    <template slot-scope="scope">
                        <span>{{scope.row.title}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="收货人姓名" >
                    <template slot-scope="scope">
                        <span>{{scope.row.content}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="联系电话" >
                    <template slot-scope="scope">
                        <span>{{scope.row.goodsnum}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="详细地址" >
                    <template slot-scope="scope">
                        <span>{{scope.row.goodsnum}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="排序" >
                    <template slot-scope="scope">
                        <span>{{scope.row.goodsnum}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="添加时间" >
                    <template slot-scope="scope">
                        <span>{{ scope.row.createtime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="address" label="操作" >
                    <template slot-scope="scope">
                        <div class="operation-group">
                            <router-link class="wlm-text" tag="span" :to="{path:'/setting/returnAddressAdd', query:{id:scope.row.id}}">
                                <el-button type="text">编辑</el-button>
                            </router-link>
                            <div class="btn-line"></div>
                            <el-button class="wlm-text" type="text" @click="delTableItem(scope.row.id)">删除</el-button>
                        </div>
                    </template>
                </el-table-column>
            </el-table>
            <div class="pagination-content flex-row flex-justify-e flex-align-c">
                <!-- <el-row class="pagination-btns">
                    <el-checkbox class="check-all"  true-label="1" false-label="0" v-model="tableFormatData.platformPack.files.checkall" @change="toggleSelection">全部</el-checkbox>
                    <el-button class="right-8" :disabled="isGroup" size="mini" @click="delTableList">删除</el-button>
                </el-row> -->
                <el-pagination :disabled="!hasTableData" @size-change="listPageChange" @current-change="listPageChange" :current-page.sync="tableFormatData.platformPack.pagination.page" :page-sizes="tableFormatData.platformPack.pagination.pagesizes" :page-size.sync="tableFormatData.platformPack.pagination.list_rows" layout="total, sizes, prev, pager, next, jumper" :total="hasTableData?tableFormatData.platformPack.pagination.total : 0">
                </el-pagination>
            </div>
        </div>
    </div>
</div>
</template>

<script>
import {
  serviceIndex,
  serlistDelete
} from '@/api/merchandise'
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Table')],
  name: 'ReturnAddress',
  components: {

  },
  data() {
    return {
      tableFormatData: {
        current: 'platformPack',
        platformPack: {
          key: 'platformPack',
          api: {
            getList: serviceIndex,
            delList: serlistDelete
          },
          tableData: [],
          files: {
            title: '',
            ids: [],
            checkall: '0'
          },
          pagination: {
            page: 1,
            list_rows: 10,
            pagesizes: [10, 20, 50],
            total: 0
          }
        }
      }
    }
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.return-address {}
</style>
